package ex.com.jm.food.service.impl;

import java.util.List;






import ex.com.jm.food.dao.AdminDao;
import ex.com.jm.food.entity.Admin;
import ex.com.jm.food.service.AdminService;
/**
 * 管理员业务实现层
 * @author zhaojw
 *
 */
public class AdminServiceImpl implements AdminService {

	/**
	 * 注入dao层
	 */
	private AdminDao adminDao;
	
	public AdminDao getAdminDao() {
		return adminDao;
	}

	public void setAdminDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}
   /**
    * 保存管理员
    */
	@Override
	public Object saveAdmin(Admin admin) {
		// TODO Auto-generated method stub
		return this.getAdminDao().saveAdmin(admin);
	}
   /**
    * 根据id查询管理员
    */
	@Override
	public Admin getAdmin(String id) {
		// TODO Auto-generated method stub
		return this.getAdminDao().getAdmin(id);
	}
    /**
     * 查询所有管理员
     */
	@Override
	public List<Admin> getAdmins(int initPage,int pageRow,String name,Integer status,String order,String sort)//查询所有
      {
		// TODO Auto-generated method stub
		return this.getAdminDao().getAdmins(initPage, pageRow, name, status, order, sort);
	}
    /**
     * 管理员登录
     */
	@Override
	public Admin adminLogin(String email, String password) {
		// TODO Auto-generated method stub
		return this.getAdminDao().adminLogin(email, password);
	}
    /**
     * 管理员修改
     */
	

	@Override
	public Admin checkEmail(String email) {
		// TODO Auto-generated method stub
		return this.getAdminDao().checkEmail(email);
	}

	@Override
	public Admin checkName(String name) {
		// TODO Auto-generated method stub
		return this.getAdminDao().checkName(name);
	}

	@Override
	public int adminsCount(String name, Integer status) {
		// TODO Auto-generated method stub
		return this.getAdminDao().adminsCount(name, status);
	}

	@Override
	public void updateAdmin(Admin admin) {
		// TODO Auto-generated method stub
		this.getAdminDao().updateAdmin(admin);
	}

	@Override
	public boolean updateAdminStatus(Integer status, String id) {
		// TODO Auto-generated method stub
		return this.getAdminDao().updateAdminStatus(status, id);
	}

}
